using Acme.BookStore.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Acme.BookStore.EntityFrameworkCore.EntityFrameworkCore.Configurations
{
    public class ShopConfiguration : IEntityTypeConfiguration<Shop>
    {
        public void Configure(EntityTypeBuilder<Shop> builder)
        {
            builder.ToTable("ShopTable");
            
            // 主键配置
            builder.HasKey(x => x.Id);
            
            // 其他属性配置
            builder.Property(x => x.ProductName).IsRequired().HasMaxLength(100);
            builder.Property(x => x.EnglishName).HasMaxLength(100);
            builder.Property(x => x.JapaneseName).HasMaxLength(100);
            builder.Property(x => x.OwnerCode).HasMaxLength(50);
            builder.Property(x => x.CustomerProductCode).HasMaxLength(50);
            builder.Property(x => x.ProductAttribute).HasMaxLength(50);
            builder.Property(x => x.Category).HasMaxLength(50);
            builder.Property(x => x.ProductType).HasMaxLength(50);
            builder.Property(x => x.SplitControl).HasMaxLength(20);
            builder.Property(x => x.BillingType).HasMaxLength(50);
            builder.Property(x => x.Barcode).HasMaxLength(50);
            builder.Property(x => x.ShelfLifeDaysUnit).HasMaxLength(20);
            builder.Property(x => x.SplitUnit).HasMaxLength(20);
            builder.Property(x => x.Sku).HasMaxLength(50);
            builder.Property(x => x.Tingyong).HasMaxLength(20);
        }
    }
} 